package com.earnings.okhttputils.utils.car.ui;

import android.app.Dialog;
import android.content.Context;
import android.support.annotation.NonNull;
import android.view.View;
import android.view.Window;
import android.widget.TextView;

import com.earnings.R;

/**
 * Created by Administrator on 2017/6/20 0020.
 */

public class SanFangXianDialog extends Dialog implements View.OnClickListener {
    private TextView wuwan_tv, shiwan_tv, ershiwan_tv, wushiwan_tv, yibaiwan_tv;
    public int index = 0;
    public String text;

    public SanFangXianDialog(@NonNull Context context) {
        super(context);
        requestWindowFeature(Window.FEATURE_NO_TITLE);
        setContentView(R.layout.dialog_sanfangxian);
        getWindow().setBackgroundDrawableResource(R.drawable.power_bg);
        wuwan_tv = (TextView) findViewById(R.id.wuwan_tv);
        findViewById(R.id.wuwan_tv).setOnClickListener(this);
        findViewById(R.id.shiwan_tv).setOnClickListener(this);
        findViewById(R.id.ershiwan_tv).setOnClickListener(this);
        findViewById(R.id.wushiwan_tv).setOnClickListener(this);
        findViewById(R.id.yibaiwan_tv).setOnClickListener(this);
        text = wuwan_tv.getText().toString();
    }

    @Override
    public void onClick(View v) {
        if (v.getId() == R.id.wuwan_tv) index = 0;
        if (v.getId() == R.id.shiwan_tv) index = 1;
        if (v.getId() == R.id.ershiwan_tv) index = 2;
        if (v.getId() == R.id.wushiwan_tv) index = 3;
        if (v.getId() == R.id.yibaiwan_tv) index = 4;
        TextView textView = (TextView) v;
        text = textView.getText().toString();
        cancel();
    }
}
